package com.yangchuang.openpicture.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yangchuang.openpicture.pojo.UserFavoriteFolder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserFavoriteFolderMapper extends BaseMapper<UserFavoriteFolder> {

    @Select("select id from user_favorite_folder where name=#{name} and user_id=#{userId}")
    Long getFolderIdByUserIdAndFolderName(@Param("name") String folderName, @Param("userId") Long userId);

    @Select("select id from user_favorite_folder where id=#{folderId} and user_id=#{userId}")
    Long getFolderIdByUserIdAndFolderId(@Param("folderId") Long folderId, @Param("userId") Long userId);
}